package plugin

/*
*backend.CheckHealthRequest:
example:

	{
		"PluginContext":{
			"OrgID":1,
			"PluginID":"grafana-mogdb-plugin",
			"User":{
				"Login":"admin",
				"Name":"",
				"Email":"admin@localhost",
				"Role":"Admin"
			},
			"AppInstanceSettings":null,
			"DataSourceInstanceSettings":{
				"ID":2,
				"UID":"HsF6dvDVz",
				"Type":"grafana-mogdb-plugin",
				"Name":"grafana-mogdb-plugin",
				"URL":"192.168.2.102:15432",
				"User":"mom",
				"Database":"mogdb",
				"BasicAuthEnabled":false,
				"BasicAuthUser":"",
				"JSONData":{

				},
				"DecryptedSecureJSONData":{
					"password":"mogdb@123"
				},
				"Updated":"2022-11-06T13:40:40Z"
			}
		},
		"Headers":null,
		"Queries":[
			{
				"RefID":"A",
				"QueryType":"",
				"MaxDataPoints":672,
				"Interval":30000000000,
				"TimeRange":{
					"From":"2022-11-06T07:56:38.308Z",
					"To":"2022-11-06T13:56:38.308Z"
				},
				"JSON":{
					"constant":6.5,
					"datasource":{
						"type":"grafana-mogdb-plugin",
						"uid":"HsF6dvDVz"
					},
					"datasourceId":2,
					"intervalMs":30000,
					"maxDataPoints":672,
					"queryText":"select version();",
					"refId":"A",
					"withStreaming":false
				}
			}
		]
	}
*/

// QueryModel is backend.CheckHealthRequest.Queries.JSON. Or maybe map[string]any ?
// sync with frontend:src/types.ts/BasicQuery
type QueryModel struct {
	Constant      float64           `json:"constant"`
	Datasource    map[string]string `json:"datasource"`
	Datasourceid  int               `json:"datasourceId"`
	Intervalms    int               `json:"intervalMs"`
	Maxdatapoints int               `json:"maxDataPoints"`
	RawSql        string            `json:"rawSql"`
	Refid         string            `json:"refId"`
	Withstreaming bool              `json:"withStreaming"`
}
